package com.thesis.manage.service.model;

import com.google.common.collect.Lists;
import com.thesis.manage.service.module.vo.TypeVO;

import java.util.List;

/**
 * @author php
 * @date 2018/3/2
 */
public enum ThesisTypeEnum {
    /**
     * 理论研究
     */
    THEORETICAL_RESEARCH(1, "理论研究"),
    /**
     * 教育教学研究
     */
    TEACHING_RESEARCH(2, "教育教学研究"),
    /**
     * 实验研究
     */
    EXPERIMENTAL_STUDY(3, "实验研究"),
    /**
     * 软件开发
     */
    SOFTWARE_PRODUCTION(4, "软件开发"),
    /**
     * 工程设计
     */
    ENGINEER_DESIGN(5, "工程设计"),
    /**
     * 工程技术研究
     */
    RESEARCH_ENGINEERING_TECHNOLOGY(6, "工程技术研究"),
    /**
     * 艺术设计
     */
    ART_DESIGN(7, "艺术设计"),
    /**
     * 艺术创作
     */
    ART_CREATION(8, "艺术创作"),
    /**
     * 其它
     */
    OTHER(9, "其它");
    private String name;
    private Integer value;

    ThesisTypeEnum(Integer value, String name) {
        this.name = name;
        this.value = value;
    }

    public static List<TypeVO> getList() {
        ThesisTypeEnum[] values = ThesisTypeEnum.values();
        List<TypeVO> list = Lists.newArrayList();
        TypeVO typeVO;
        for (ThesisTypeEnum thesisTypeEnum : values) {
            typeVO = new TypeVO();
            typeVO.setValue(thesisTypeEnum.getValue());
            typeVO.setName(thesisTypeEnum.getName());
            list.add(typeVO);
        }
        return list;
    }

    public static String getName(Integer value) {
        switch (value) {
            case 1:
                return THEORETICAL_RESEARCH.getName();
            case 2:
                return TEACHING_RESEARCH.getName();
            case 3:
                return EXPERIMENTAL_STUDY.getName();
            case 4:
                return SOFTWARE_PRODUCTION.getName();
            case 5:
                return ENGINEER_DESIGN.getName();
            case 6:
                return RESEARCH_ENGINEERING_TECHNOLOGY.getName();
            case 7:
                return ART_DESIGN.getName();
            case 8:
                return ART_CREATION.getName();
            case 9:
                return OTHER.getName();
            default:
                return "";
        }
    }

    public String getName() {
        return name;
    }

    public Integer getValue() {
        return value;
    }
}
